package ar.com.ford.it.fullEconomics.interfaces.threadExecutor;

import java.sql.Timestamp;
import ar.com.ford.it.fullEconomics.interfaces.ReadFile;
import ar.com.ford.it.fullEconomics.interfaces.WorkerReadFile;
import ar.com.ford.it.fullEconomics.logic.LogProcessLogic;
import ar.com.ford.it.fullEconomics.persistence.dto.Teesx03Intflog;
import commonj.timers.Timer;
import commonj.timers.TimerListener;

public class TimerFtpFileDownloader implements TimerListener {

	public String toString()
	{
		return this.getProcessName();
	}
	
	private String getProcessName()
	{
		return "TimerFtpFileDownloader";
	}
	
	public void timerExpired(Timer arg0) {

		    System.out.println("+++ Ejecutando: " + this.toString() + " desde TimerManager");		
 	        LogProcessLogic logProcess = new LogProcessLogic();
	        String userId = "p_feefmc";
	        ReadFile parser;
	        Teesx03Intflog intflog = null;
	        
	        try {
	        	WorkerReadFile wrf = new WorkerReadFile();
	        	wrf.downloadFileFromFtptoBlob();
	        	System.out.println("+++ finalizando: " + this.toString() + " desde TimerManager");
	        } catch (Exception e) {
	            logProcess.updateLogInfo(intflog, "C", new Timestamp(System
	                    .currentTimeMillis()));
          	}

	
}
	
}
